<?php
	if (!isset($OBJCTCL)) {
		$OBJCTCL = $_POST['OBJCTCL'];
	}
	$GETSYSSETTINGS = $GLOBALS['MYT']->db_array("SELECT ast_Value FROM systemoffice.administration_settings WHERE ast_ID = 2");
	if ($GETSYSSETTINGS[1]['ast_Value'] > 0) {
	echo '<div id="Bsp_Action"></div>';
	$GETCMG = $GLOBALS['MYT']->db_array("SELECT bss_ID, NAME AS bss_Name FROM bonus_productstocks
		INNER JOIN bonusproducts ON bss_Product = REF
	WHERE bss_Office = {$_SESSION[$SESSCD]} AND bss_Product = {$GETSYSSETTINGS[1]['ast_Value']}
		AND bss_Status = 3");
	$CHKDUP = $GLOBALS['MYT']->db_array("SELECT REF FROM bonusinvoices
		WHERE bns_Origen1 = {$_SESSION[$SESSCD]} AND bns_Product = {$GETSYSSETTINGS[1]['ast_Value']}
		AND bns_Status = 2 AND Client = {$OBJCTCL} AND bns_Time BETWEEN '{$_POST['bns_time']}' AND DATE_SUB('{$_POST['bns_time']}', INTERVAL 20 SECONDS)");
	if (isset($GETCMG[1])) {
		 echo '<script charset="utf-8" type="text/javascript">
		var properties = new Ext.Window({
		title:\'Brindes em Destaque\',
		autoLoad: \''.$GLOBALS['URL'].'Modules/MF93FL27/lib/ppdestben.mex?RSID='.$OBJCTCL.'&CPID='.$GETCMG[1]['bss_ID'].'&CVAL='.$Fi30.'\',
		modal:true,
		id:\'win_dtkben\',
		width:400,
		height:300,
		closable:false,
		resizable:false
		});
		properties.show();
		</script>';
	 }
	}